<?php include "conn.php";
$order_id = isset($_GET['order_id']) ? $_GET['order_id'] :-1;
$shop_id = isset($_GET['shop_id']) ? $_GET['shop_id'] :-1;
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$perpage = 10;
$c=($page-1)*$perpage;
if($order_id >0)
{
<<<<<<< .mine
	$user_order= mysqli_query($conn, "SELECT * FROM `biz_waimai_order` WHERE order_id = $order_id");
	while($row_order = mysqli_fetch_array($user_order))
	{
		$price_sum += $row_order['price']*$row_order['number'];
	    $data_order[] = $row_order;
		
	}	
	$user_dish = mysqli_query($conn, "SELECT * ,o.create_dt,o.address,o.mobile,o.telphone,s.telphone as tel_shop,s.sms_number as sms FROM `biz_order` o LEFT JOIN `biz_shop` s ON o.shop_id = s.shop_id WHERE o.order_id = $order_id ORDER BY o.create_dt DESC limit $c,$perpage");
=======
    $user_order= mysqli_query($conn, "SELECT * FROM `biz_waimai_order` WHERE order_id = $order_id");
    while($row_order = mysqli_fetch_array($user_order))
    {
        $price_sum += $row_order['price']*$row_order['number'];
        $data_order[] = $row_order;

    }
    $user_dish = mysqli_query($conn, "SELECT * ,o.create_dt,o.address,o.mobile,o.telphone,s.telphone as tel_shop,s.sms_number as sms FROM `biz_order` o LEFT JOIN `biz_shop` s ON o.shop_id = s.shop_id WHERE o.order_id = $order_id ORDER BY o.create_dt DESC limit $c,$perpage");
>>>>>>> .r497
}
else{
$user_dish = mysqli_query($conn, "SELECT * ,o.create_dt,o.address,o.mobile,o.telphone,s.sms_number as sms FROM `biz_order` o LEFT JOIN `biz_shop` s ON o.shop_id = s.shop_id WHERE o.user_id = '0' ORDER BY o.create_dt DESC limit $c,$perpage");
    }
while($row = mysqli_fetch_array($user_dish))
    {
        $data[] = $row;
    }

?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="速订客 在线订餐订单" />
<meta name="description" content="速订客 在线订餐订单" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
<meta http-equiv="Cache-control" content="no-cache" />
<meta name="viewport" content="width=device-width; initial-scale=1.0;  minimum-scale=1.0; maximum-scale=2.0"/>
<meta name="MobileOptimized" content="240"/>
<meta name="Iphone-content" content="320"/>
<meta name="format-detection" content="telephone=no" />
<title>订单管理</title>
<link rel="apple-touch-icon-precomposed" href="#" />
<link rel="icon" href="/favicon.ico?v=2" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico?v=2" type="image/x-icon" />
<link href="css/common.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="page-wrap">
<<<<<<< .mine
	<div id="inside">
		<div id="header">
			<div class="line-logo">
				<a href="http://m.sudingke.com/waimai" title="速订客" class="logo"><img title="速订客" alt="速订客" src="img/logo.png" /></a><div style="float:right; padding-right:30px;"><a href="http://m.sudingke.com/waimai/order.php">订单管理</a>&nbsp;&nbsp;<a href="http://m.sudingke.com/waimai/order_shop.php">商家排名</a></div></div>
			<div class="line-top"></div>
			<div class="line-nav">
				<p>&nbsp;</p>
			</div>
		</div>
		<div id="main-content">
=======
    <div id="inside">
        <div id="header">
            <div class="line-logo">
                <a href="http://m.sudingke.com/waimai" title="速订客" class="logo"><img title="速订客" alt="速订客" src="img/logo.png" /></a><div style="float:right; padding-right:30px;"><a href="http://m.sudingke.com/waimai/order.php">订单管理</a></div></div>
            <div class="line-top"></div>
            <div class="line-nav">
                <p>&nbsp;</p>
            </div>
        </div>
        <div id="main-content">
>>>>>>> .r497

      <table class="restaurant-list-table">
        <?php
<<<<<<< .mine
		if($order_id == -1)
		{
      
		if($data)
		{
			foreach($data as $row){
		?>
			<tr class="open">
          		<td valign="top">&nbsp;</td>
          		<td class="info">
                <div class="description"><a href="/waimai/order.php?order_id=<?=$row['order_id'];?>&shop_id=<?=$row['shop_id'];?>"><span>订单号码:</span><span class="deliver-amount">&nbsp;<?=$row['order_code'];?></span></a></div>
                <div class="status"><span>订单时间:</span><span class="deliver-amount"><?=$row['create_dt'];?></span> </div>
=======
        if($order_id == -1)
        {

        if($data)
        {
            foreach($data as $row){
        ?>
            <tr class="open">
                <td valign="top">&nbsp;</td>
                <td class="info">
                <div class="description"><a href="/waimai/order.php?order_id=<?=$row['order_id'];?>&shop_id=<?=$row['shop_id'];?>"><span>订单号码:</span><span class="deliver-amount">&nbsp;<?=$row['order_code'];?></span></a></div>
                <div class="status"><span>订单时间:</span><span class="deliver-amount"><?=$row['create_dt'];?></span> </div>
>>>>>>> .r497
                <div class="description"><span>联系人:</span><span class="deliver-amount">&nbsp;<?=$row['realname'];?></span></div>
<<<<<<< .mine
            	<div class="status"><span>手机:</span><span class="deliver-amount"><?=$row['mobile'];?></span> </div>
                <div class="status"><span>电话:</span><span class="deliver-amount"><?=$row['telphone'];?></span> </div>
=======
                <div class="status"><span>手机:</span><span class="deliver-amount"><?=$row['mobile'];?></span> </div>
                <div class="status"><span>电话:</span><span class="deliver-amount"><?=$row['telphone'];?></span> </div>
>>>>>>> .r497
                <div class="status"><span>送餐地址:</span><span class="deliver-amount"><?=$row['address'];?></span> </div>
<<<<<<< .mine
                <div class="name"><a href="/waimai/orders.php?order_id=<?=$row['order_id'];?>&shop_id=<?=$row['shop_id'];?>"><span><?= $row['name'];?>&nbsp;(历史详情)</span></a></div>
            	</td>
        	</tr>
        <?php 
			} }}
			else
			{
			foreach($data as $row){
		?>
        <tr class="open">    		
          	<td valign="top">&nbsp;</td>
          		<td class="info">
                <div class="description"><span>订单号码:</span><span class="deliver-amount">&nbsp;<?=$row['order_code'];?></span></div>
                <div class="status"><span>订单时间:</span><span class="deliver-amount"><?=$row['create_dt'];?></span> </div>
                <br \> 
                <div class="description"><span>联系人:</span><span class="deliver-amount">&nbsp;<?=$row['realname'];?></span></div>
            	<div class="status"><span>手机:</span><span class="deliver-amount"><?=$row['mobile'];?></span> </div>
=======
                <div class="name"><a href="/waimai/orders.php?order_id=<?=$row['order_id'];?>&shop_id=<?=$row['shop_id'];?>"><span><?= $row['name'];?>&nbsp;(历史详情)</span></a></div>
                </td>
            </tr>
        <?php
            } }}
            else
            {
            foreach($data as $row){
        ?>
        <tr class="open">
            <td valign="top">&nbsp;</td>
                <td class="info">
                <div class="description"><span>订单号码:</span><span class="deliver-amount">&nbsp;<?=$row['order_code'];?></span></div>
                <div class="status"><span>订单时间:</span><span class="deliver-amount"><?=$row['create_dt'];?></span> </div>
                <br \>
                <div class="description"><span>联系人:</span><span class="deliver-amount">&nbsp;<?=$row['realname'];?></span></div>
                <div class="status"><span>手机:</span><span class="deliver-amount"><?=$row['mobile'];?></span> </div>
>>>>>>> .r497
                <div class="status"><span>电话:</span><span class="deliver-amount"><?=$row['telphone'];?></span> </div>
                <div class="status"><span>送餐地址:</span><span class="deliver-amount"><?=$row['address'];?></span> </div>
                <div class="description"><span class="open">备注:</span><span class="deliver-amount">&nbsp;<?=$row['memo'];?></span></div>
<<<<<<< .mine
                <br \> 
=======
                <br \>
>>>>>>> .r497
              <div class="description"><span class="open">下单菜品:&nbsp;&nbsp;总计<?=$price_sum;?>元</span></div>
               <?   foreach($data_order as $row_order){
?>
               <div class="description"><span class="deliver-amount"><?=$row_order['name'];?>&nbsp;&nbsp;(<?=$row_order['price'];?>元&nbsp;&nbsp;<?=$row_order['number'];?>份)</span></div>

               <? }?>
<<<<<<< .mine
               <br \> 
               <div class="description" style="color:#0088C8"><span>商家:</span><span class="deliver-amount">&nbsp;<?=$row['name'];?></span></div>
               <div class="description" style="color:#0088C8"><span>电话:</span><span class="deliver-amount">&nbsp;<?=$row['tel_shop'];?></span></div>
               <div class="description"  style="color:#0088C8"><span>短信号码:<?=$row['sms'];?></span></div>
               <div class="status"  style="color:#0088C8"><span>送餐时间:</span><span class="deliver-amount"><? $list_data=(unserialize($row['list_data'])); 
				echo $list_data['delivery_time'];?></span> </div>
               <div class="description"  style="color:#0088C8"><span>配送范围:</span><?=$list_data['delivery_desc'];?></div>
            	</td></tr><? }} ?>
=======
               <br \>
               <div class="description" style="color:#0088C8"><span>商家:</span><span class="deliver-amount">&nbsp;<?=$row['name'];?></span></div>
               <div class="description" style="color:#0088C8"><span>电话:</span><span class="deliver-amount">&nbsp;<?=$row['tel_shop'];?></span></div>
               <div class="description"  style="color:#0088C8"><span>短信号码:<?=$row['sms'];?></span></div>
               <div class="status"  style="color:#0088C8"><span>送餐时间:</span><span class="deliver-amount"><? $list_data=(unserialize($row['list_data']));
                echo $list_data['delivery_time'];?></span> </div>
               <div class="description"  style="color:#0088C8"><span>配送范围:</span><?=$list_data['delivery_desc'];?></div>
                </td></tr><? }} ?>
>>>>>>> .r497
      </table>

    </div>
    <div style="clear: both;"><br \><br \><br \><br \></div>
    <div id="footer">
      <div class="line-footer-nav"> <a href="http://m.sudingke.com/waimai/order.php">回到订单管理首页</a><span class="delimiter">|</span>
        <!-- <a href="/feedback">反馈留言</a><span class="delimiter">|</span>
                <a href="/about">关于我们</a> -->
      </div>
      <div class="line-copyright">
        <p style="text-align:center">客服热线：<a href="wtai://wp/mc;4000411569">400-0411-569</a>电话：<a href="wtai://wp/mc;041183638475">0411-83638475</a><br/>(工作时间：周一至周五 9:30 至 18:00)

<br/>
         Copyright © 2012 大连凌睿科技有限公司 版权所有 辽ICP备11013684号-3</p>
      </div>
    </div>
  </div>
  <div style="clear: both;"></div>
</div>
</body>
</html>
